home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 43 / Mac Magazin and MacEasy Magazine CD - Issue 43.iso / Software / Mobiles Büro / Newton / Newton Entwickler / DIL 2.0 Mac OS ƒ / Headers / PDIL.h < prev   
Text File  |  1997-09-19  |  8KB  |  238 lines

  1. /*
  2.     File:        PDIL.h, v2.0a2
  3.  
  4.     Contains:    Public interface to the Desktop Integration Library
  5.  
  6.     Copyright:    Apple Computer, Inc. 1997, all rights reserved.
  7. */
  8.  
  9. #ifndef __PDIL_H
  10. #define __PDIL_H
  11.  
  12. #ifndef __DIL_H
  13. #include "DIL.h"
  14. #endif
  15.  
  16. #ifndef __FDIL_H
  17. #include "FDIL.h"
  18. #endif
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. /* --- PD_Idle result codes --- */
  25.  
  26. typedef long    PD_Status;
  27.  
  28. #define    kPD_Okay        0
  29. #define kPD_AutoDock    1
  30. #define kPD_Cancel        2
  31. #define kPD_Disconnect    3
  32. #define kPD_Hello        4
  33.  
  34. /* --- the status callback --- */
  35.  
  36. typedef DIL_Error (*DIL_StatusProc)(long* bytesAvailable, void* userData);
  37.  
  38. /* --- PDIL error numbers --- */
  39.  
  40. #define kPD_NotInitialized        (kPD_ErrorBase - 1)
  41. #define kPD_InvalidSession        (kPD_ErrorBase - 2)
  42. #define kPD_InvalidStore        (kPD_ErrorBase - 3)
  43. #define kPD_InvalidSoup            (kPD_ErrorBase - 4)
  44. #define kPD_InvalidCursor        (kPD_ErrorBase - 5)
  45. #define kPD_NewtonError            (kPD_ErrorBase - 6)
  46. #define kPD_InvalidROMVersion    (kPD_ErrorBase - 7)
  47. #define kPD_InvalidPassword        (kPD_ErrorBase - 8)
  48.  
  49. /* --- PDIL last result error numbers --- */
  50. /* !!! WARNING-- THIS MAY CHANGE SOON !!! */
  51.  
  52. #define kPD_BadStoreSignature                (-28001)
  53. #define kPD_BadEntry                        (-28002)
  54. #define kPD_Aborted                            (-28003)
  55. #define kPD_BadQuery                        (-28004)
  56. #define kPD_ReadEntryError                    (-28005)
  57. #define kPD_BadCurrentSoup                    (-28006)
  58. #define kPD_BadCommandLength                (-28007)
  59. #define kPD_EntryNotFound                    (-28008)
  60. #define kPD_BadConnection                    (-28009)
  61. #define kPD_FileNotFound                    (-28010)
  62. #define kPD_IncompatableProtocol            (-28011)
  63. #define kPD_ProtocolError                    (-28012)
  64. #define kPD_DockingCanceled                    (-28013)
  65. #define kPD_StoreNotFound                    (-28014)
  66. #define kPD_SoupNotFound                    (-28015)
  67. #define kPD_BadHeader                        (-28016)
  68. #define kPD_OutOfMemory                        (-28017)
  69. #define kPD_NewtonVersionTooNew                (-28018)
  70. #define kPD_PackageCantLoad                    (-28019)
  71. #define kPD_ProtocolExtAlreadyRegistered    (-28020)
  72. #define kPD_RemoteImportError                 (-28021)
  73. #define kPD_BadPasswordError                (-28022)
  74. #define kPD_RetryPW                            (-28023)
  75. #define kPD_IdleTooLong                        (-28024)
  76. #define kPD_OutOfPower                        (-28025)
  77. #define kPD_BadCursor                        (-28026)
  78. #define kPD_AlreadyBusy                        (-28027)
  79. #define kPD_DesktopError                    (-28028)
  80. #define kPD_CantConnectToModem                (-28029)
  81. #define kPD_Disconnected                    (-28030)
  82. #define kPD_AccessDenied                    (-28031)
  83.  
  84. /* --- PDIL data types --- */
  85.  
  86. DECLARE_DIL_HANDLE(PD_Handle);
  87. DECLARE_DIL_HANDLE(PD_Cursor);
  88.  
  89. /* --- Newton icon bit definitions --- */
  90.  
  91. typedef long PD_IconMask;
  92.  
  93. #define kPD_NoIcons            (0L)
  94. #define kPD_BackupIcon        (1 << 0)
  95. #define kPD_RestoreIcon        (1 << 1)
  96. #define kPD_InstallIcon        (1 << 2)
  97. #define kPD_ImportIcon        (1 << 3)
  98. #define kPD_SyncIcon        (1 << 4)
  99. #define kPD_KeyboardIcon    (1 << 5)
  100. #define kPD_AllIcons        (-1L)
  101.  
  102. /* --- Newton System Information block --- */
  103.  
  104. struct PD_NewtonSystemInfo
  105. {
  106.     long        fNewtonID;            /* A unique id to identify a particular newton */
  107.     long        fManufacturer;        /* A decimal integer indicating the manufacturer of the device */
  108.     long        fMachineType;        /* A decimal integer indicating the hardware type of the device */
  109.     long        fROMVersion;        /* A decimal number indicating the major and minor ROM version numbers */
  110.                                     /* The major number is in front of the decimal, the minor number after */
  111.     long        fROMStage;            /* A decimal integer indicating the language (English, German, French) */
  112.                                     /* and the stage of the ROM (alpha, beta, final) */
  113.     long        fRAMSize;
  114.     long        fScreenHeight;        /* An integer representing the height of the screen in pixels */
  115.     long        fScreenWidth;        /* An integer representing the width of the screen in pixels */
  116.     long        fPatchVersion;        /* 0 on an unpatched Newton and nonzero on a patched Newton */
  117.     long        fNOSVersion;
  118.     long        fInternalStoreSig;    /* signature of the internal store */
  119.     long        fScreenResolutionV;    /* An integer representing the number of vertical pixels per inch */
  120.     long        fScreenResolutionH;    /* An integer representing the number of horizontal pixels per inch */
  121.     long        fScreenDepth;        /* The bit depth of the LCD screen */
  122.     long        fSystemFlags;        /* various bit flags */
  123.                                         /* 1 = has serial number */
  124.                                         /* 2 = has target protocol */
  125.     long        fSerialNumber[2];
  126.     long        fTargetProtocol;
  127. };
  128. typedef struct PD_NewtonSystemInfo PD_NewtonSystemInfo;
  129. typedef PD_NewtonSystemInfo* PD_NewtonSystemInfoPtr;
  130.  
  131. /* --- Startup/Shutdown functions --- */
  132.  
  133. DILAPI DIL_Error    PD_Startup            (void);
  134. DILAPI DIL_Error    PD_Shutdown            (void);
  135.  
  136. /* --- Session functions --- */
  137.  
  138. DILAPI DIL_Error    PD_CreateSession    (PD_Handle*,
  139.                                             DIL_ReadProc,
  140.                                             DIL_StatusProc,
  141.                                             DIL_WriteProc,
  142.                                             void*        inUserData,
  143.                                             const char* inPassword,
  144.                                             long        inAttempts);
  145. DILAPI DIL_Error    PD_Dispose            (PD_Handle);
  146. DILAPI PD_Status    PD_Idle                (PD_Handle);
  147.  
  148. /* --- Information functions --- */
  149.  
  150. DILAPI DIL_Error    PD_GetNewtonError    (PD_Handle);
  151. DILAPI DIL_Error    PD_GetNewtonInfo    (PD_Handle, PD_NewtonSystemInfoPtr* outNewtonInfo);
  152. DILAPI DIL_Error    PD_GetNewtonName    (PD_Handle, FD_Handle* outNewtonName);
  153. DILAPI DIL_Error    PD_SetStatusText    (PD_Handle, const char* inText);
  154.  
  155. /* --- Store functions --- */
  156.  
  157. DILAPI DIL_Error    PD_GetAllStores        (PD_Handle, FD_Handle* outStores);
  158. DILAPI DIL_Error    PD_GetCurrentStore    (PD_Handle, FD_Handle* outStore);
  159. DILAPI DIL_Error    PD_GetDefaultStore    (PD_Handle, FD_Handle* outStore);
  160. DILAPI DIL_Error    PD_SetCurrentStore    (PD_Handle, FD_Handle  inStore);
  161.                                         /* if inStore is nil, set to default store */
  162.  
  163. /* --- Soup functions --- */
  164.  
  165. DILAPI DIL_Error    PD_CreateSoup        (PD_Handle,
  166.                                             const char* inSoupName,
  167.                                             FD_Handle    inSoupIndex);
  168. DILAPI DIL_Error    PD_DeleteSoup        (PD_Handle, FD_Handle  inSoupName);
  169. DILAPI DIL_Error    PD_EmptySoup        (PD_Handle, FD_Handle  inSoupName);
  170. DILAPI DIL_Error    PD_GetAllSoups        (PD_Handle, FD_Handle* outSoups);
  171. DILAPI DIL_Error    PD_GetCurrentSoup    (PD_Handle, FD_Handle* outSoupName);
  172. DILAPI DIL_Error    PD_SetCurrentSoup    (PD_Handle, FD_Handle  inSoupName);
  173.  
  174. /* --- Entry functions --- */
  175.  
  176. DILAPI DIL_Error    PD_AddEntry            (PD_Handle, FD_Handle  inEntry, long* outUniqueID);
  177. DILAPI DIL_Error    PD_ChangeEntry        (PD_Handle, FD_Handle  inEntry);
  178. DILAPI DIL_Error    PD_DeleteEntries    (PD_Handle, FD_Handle  inEntryIDs);
  179. DILAPI DIL_Error    PD_GetEntry            (PD_Handle, FD_Handle* outEntry, long inUniqueID);
  180. DILAPI DIL_Error    PD_GetSoupIDs        (PD_Handle, FD_Handle* outSoupIDs);
  181.  
  182. /* --- Cursor functions --- */
  183.  
  184. DILAPI    DIL_Error    PD_Query            (PD_Handle, PD_Cursor* outCursor,
  185.                                             FD_Handle inSoupName,
  186.                                             FD_Handle inQuerySpec);
  187.  
  188. DILAPI DIL_Error    PD_CountEntries        (PD_Cursor, long* outCount);
  189. DILAPI DIL_Error    PD_DisposeCursor    (PD_Cursor);
  190. DILAPI DIL_Error    PD_Entry            (PD_Cursor, FD_Handle* outEntry);
  191. DILAPI DIL_Error    PD_GotoKey            (PD_Cursor, FD_Handle* outEntry, FD_Handle inKey);
  192. DILAPI DIL_Error    PD_Move                (PD_Cursor, FD_Handle* outEntry, long inOffset);
  193. DILAPI DIL_Error    PD_Next                (PD_Cursor, FD_Handle* outEntry);
  194. DILAPI DIL_Error    PD_Prev                (PD_Cursor, FD_Handle* outEntry);
  195. DILAPI DIL_Error    PD_Reset            (PD_Cursor, FD_Handle* outEntry);
  196. DILAPI DIL_Error    PD_ResetToEnd        (PD_Cursor, FD_Handle* outEntry);
  197.  
  198. /* --- package loading --- */
  199.  
  200. DILAPI DIL_Error    PD_LoadPackage        (PD_Handle,
  201.                                             long        inLength,
  202.                                             long        inChunkSize,
  203.                                             DIL_ReadProc inReadProc,
  204.                                             void*        inUserData);
  205.  
  206. /* --- Protocol Extensions --- */
  207.  
  208. DILAPI DIL_Error    PD_CallExtension    (PD_Handle,
  209.                                             long        extensionID,
  210.                                             FD_Handle    inParams,
  211.                                             FD_Handle*    outResult);
  212.  
  213. DILAPI DIL_Error    PD_LoadExtension    (PD_Handle,
  214.                                             long        inExtensionID,
  215.                                             FD_Handle    inExtension);
  216.  
  217. DILAPI DIL_Error    PD_RemoveExtension    (PD_Handle,
  218.                                             long        extensionID);
  219.  
  220. /* --- Global/Root Functions --- */
  221.  
  222. DILAPI DIL_Error    PD_CallGlobalFunction (PD_Handle,
  223.                                             const char*    inFunctionName,
  224.                                             FD_Handle    inParamsArray,
  225.                                             FD_Handle*    outResult);
  226.  
  227. DILAPI DIL_Error    PD_CallRootMethod    (PD_Handle,
  228.                                             const char*    inMethodName,
  229.                                             FD_Handle    inParamsArray,
  230.                                             FD_Handle*    outResult);
  231. #ifdef __cplusplus
  232. }
  233. #endif
  234.  
  235. #endif /* __PDIL_H */
  236.  
  237.  
  238.